home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
mcu332
/
c32src.arc
/
CHIPSEL.LST
next >
Wrap
File List
|
1991-03-01
|
47KB
|
795 lines
Motorola Family Assembler BETA TEST VERSION (2.1.5 ) Fri Mar 01 13:32:16 1991
M68300 BUSINESS CARD COMPUTER CHIP SELECT INIT
abs. rel. LC obj. code source line
---- ---- ---- --------- -----------
1 1 | TTL M68300 BUSINESS CARD COMPUTER CHIP SELECT INIT
2 2 | OPT P=68332 SETUP FOR 68332 CODE
3 3 | OPT BRS SHORT BRANCHES PREFERED
4 4 |
5 5 |******************************************************************************
6 6 |*** EXPORTED PORTION OF THE MODULE HEADER ***
7 7 |*V****************************************************************************
8 8 |******************************************************************************
9 9 |*** ***
10 10 |*** MODULE : CHIP SELECT INITIALIZATION ***
11 11 |*** ***
12 12 |*** ENVIRONMENT : 68300 Business Card Computer (BCC) Rev. A, B ***
13 13 |*** For M68300PFB Platform Board, Rev. A, B, C ***
14 14 |*** ***
15 15 |*** NOTE: BCC Rev. A + PFB Rev. A = Old System ***
16 16 |*** BCC Rev. B + PFB Rev. B = New System ***
17 17 |*** ***
18 18 |*** PFB Rev. C is jumper selectable to be function- ***
19 19 |*** ally equivalent to Rev. A or to Rev. B. ***
20 20 |*** ***
21 21 |*** ---- DO NOT MIX REV. A's WITH REV. B's! ---- ***
22 22 |*** ---- NO STACK USAGE (SUBR'S) ALLOWED! ---- ***
23 23 |*** ***
24 24 |*** LANGUAGE : 68332 ASSEMBLY LANGUAGE ***
25 25 |*** ***
26 26 |*** SUMMARY OF CONTENTS : ***
27 27 |*** Determines BCC type (A or B) and initializes the appropriate chip ***
28 28 |*** selects using the corresponding values from the parameter area. ***
29 29 |*** ***
30 30 |*** LINK REQUIREMENTS : ***
31 31 |*** NOTES: ***
32 32 |*** 1. Source equivalent copy of CPU32Bug parameter area for Motorola ***
33 33 |*** FREEWARE Bulletin Board System (BBS) to produce object ***
34 34 |*** equivalent code. See REVISION HISTORY below for version nbr. ***
35 35 |*** 2. This source code can be freely used at no cost/obligation, ***
36 36 |*** i.e. it is PUBLIC DOMAIN software. Please report any errors/ ***
37 37 |*** additions to the SYSOP of the Motorola FREEWARE BBS. ***
38 38 |*** 3. Parameters which reference linker symbols (XREF/XDEF) will ***
39 39 |*** not be defined until link time, so the obj. code listed here ***
40 40 |*** will not match the actual EPROM code. ***
41 41 |*** ***
42 42 |******************************************************************************
43 43 |*^****************************************************************************
44 44 |*
45 45 | PAGE
46 46 |*
47 47 |******************************************************************************
48 48 |*** INTERNAL PORTION OF THE MODULE HEADER ***
49 49 |******************************************************************************
50 50 |*** ***
51 51 |*** REVISION HISTORY (add changes to the top): ***
52 52 |*** ***
53 53 |*** DATE AUTHOR CHANGES ***
54 54 |*** ---------- --------------- ------------------------------------- ***
55 55 |*** 03/01/91 Peter S. Gilmour Compatible with CPU32Bug version 1.00. ***
56 56 |*** 05/02/90 Peter S. Gilmour Compatible with 332Bug version 1.02. ***
57 57 |*** 01/17/90 Peter S. Gilmour Initial version port to MS_DOS based ***
58 58 |*** M68MASM from original source code. ***
59 59 |*** Compatible with 332Bug version 1.01. ***
60 60 |******************************************************************************
61 61 |*** XDEFS : ***
62 62 | XDEF INIT_CS
63 63 |*** ***
64 64 |*** XREFS : ***
65 65 | XREF PWR_TBL2
66 66 | XREF .CSBAR0,.CSBAR1,.CSBAR2,.CSBARBT
67 67 | XREF CSBAR0$
68 68 | XREF MCR_OR,MCR_AND
69 69 | XREF SYPCR_OR,SYPCR_AND
70 70 |*** ***
71 71 |*** Local macros: ***
72 72 |*** ***
73 73 |SYSTEM MACRO ! SETUP MONITOR SPACE
74 74 |SECTD SET 1 ! DEFINE DATA SECTION
75 75 |SECTP SET 14 ! DEFINE PROGRAM SECTION
76 76 | SECTION SECTP ! PUT USER INTO PROG. SECTION
77 77 | ENDM !
78 78 |*
79 79 |* Time delay macro
80 80 |* - allows bus capacitance to dissipate
81 81 |* - at least 3 words must be fetched to guarantee dissipation
82 82 |*
83 83 |T_DELAY MACRO
84 84 | NOP
85 85 | NOP
86 86 | NOP
87 87 | ENDM
88 88 |
89 89 |***
90 90 |*** Local equates:
91 91 |***
92 92 0000 0000 |OLD_BCC EQU 0 Code ID for old BCC
93 93 0000 0001 |NEW_BCC EQU 1 Code ID for new BCC
94 94 |
95 95 |*
96 96 |* For M68300 BCC and PFB.
97 97 |*
98 98 |* NOTE: Unused upper address lines are specified as 1's so ABSOLUTE SHORT
99 99 |* addressing (sign extension) can be used.
100 100 |*
101 101 0000 2700 |SR_VAL EQU $2700 Status register initial value.
102 102 |
103 103 0000 0000 |RAM_BASE EQU $0 BCC RAM base address
104 104 0001 0000 |RAM_SIZE EQU $10000 BCC RAM size (bytes)
105 105 000E 0000 |ROM1_BASE EQU $E0000 BCC EPROM base address
106 106 0002 0000 |ROM1_SIZE EQU $20000 BCC EPROM size (bytes)
107 107 0004 0000 |IRAM_BASE EQU $40000
108 108 FFFF E800 |FPCP_BASE EQU $FFFFE800 PFB MC68881/MC6882 base address
109 109 |* . (Floating Point Co-Processor)
110 110 0000 8000 |FCRYSTVAL EQU 32768 Crystal frequency (in Hz)
111 111 FFFF F000 |HI_BASE EQU $FFFFF000 CPU32 module (registers) base high addr
112 112 |* . This is the default used at power-up!
113 113 007F F000 |LO_BASE EQU $007FF000 CPU32 module (registers) base low addr
114 114 0000 0A00 |SIM EQU $A00 CPU32 System Integration Module base addr
115 115 0000 0B00 |RAMCR EQU $B00 CPU32 RAM Control Module base offset
116 116 0000 0C00 |QSM EQU $C00 CPU32 Queued Serial Module base offset
117 117 FFFF F800 |AUTO_BASE EQU $FFFFF800 Autovector base address
118 118 |
119 119 |* Define bits for Power Up Status (PWRSTATUS) flag:
120 120 0000 001F |EXTAL_BIT EQU 31 External Clock flag bit: 0= off (VCO)
121 121 0000 001E |CHKSUM_BIT EQU 30 Checksum not pgm'd yet bit: 0= pgm'd
122 122 |
123 123 0000 0000 |LOCALRAM EQU RAM_BASE base of local RAM
124 124 0000 4000 |SYSRAMSZ EQU $00004000 size of local RAM (for system use)
125 125 0001 0000 |LCLRAMMX EQU RAM_SIZE max size of local RAM (for M68332 BCC)
126 126 0000 4000 |USRRAM EQU LOCALRAM+SYSRAMSZ base of user RAM
127 127 0000 C000 |USRRAMSZ EQU LCLRAMMX-SYSRAMSZ size of user RAM
128 128 0000 0000 |RAMSTART EQU LOCALRAM alias for base of local RAM
129 129 |
130 130 000E 0000 |LOCALROM EQU ROM1_BASE base of local ROM (use PC rel refs!)
131 131 0001 0000 |LCLROMSZ EQU $00010000 size of local ROM used by 332Bug
132 132 0000 00FF |ROMUNPGM EQU $FF unprogrammed state of a byte of EPROM
133 133 0000 00FF |FILL.1 EQU ROMUNPGM fill value for 1 byte = BYTE
134 134 0000 FFFF |FILL.2 EQU FILL.1<<8+FILL.1 fill value for 2 bytes= WORD
135 135 FFFF FFFF |FILL.4 EQU FILL.2<<16+FILL.2 fill value for 4 bytes= LONG WORD
136 136 |
137 137 0001 0000 |RAM2_BASE EQU LOCALRAM+LCLRAMMX Next RAM base address
138 138 0010 0000 |ROM2_BASE EQU ROM1_BASE+ROM1_SIZE Next ROM base address
139 139 |
140 140 0000 0400 |VECTSIZ EQU $400 Vector table size
141 141 0000 1000 |USERLEN EQU $1000 user space reserved
142 142 0000 4000 |MEMINC EQU $4000 memory increment for 130's or EVM's
143 143 0000 2BFC |STKLEN EQU MEMINC-USERLEN-VECTSIZ-4 size of bug/diag stack + static vars
144 144 |
145 145 |*
146 146 |* Interrupt levels & vectors
147 147 |*
148 148 0000 0007 |ABORTLVL EQU 7 abort level
149 149 0000 001F |ABORTVEC EQU 31 abort vector
150 150 0000 0007 |ACFAILVL EQU 7 AC-Fail level
151 151 0000 0041 |ACFAILVC EQU 65 AC-Fail vector
152 152 0000 0006 |TIMERLVL EQU 6 timer level: M68332 periodic int. timer
153 153 0000 0042 |TIMERVEC EQU 66 timer vector
154 154 |
155 155 |*
156 156 |* Setup Base Addresses:
157 157 |* 1. A31-A24 must= 0 (MC68332 only uses A0-A23; rest are unused!)
158 158 |* 2. A10-A0 must= 0 (for Base Address Register usage).
159 159 |*
160 160 00FF F800 |ADDRMASK EQU $00FFF800 Address mask (24-bits, A10-A0= 0)
161 161 0000 0000 |RAM EQU RAM_BASE&ADDRMASK Setup Base Addresses
162 162 000E 0000 |ROM EQU ROM1_BASE&ADDRMASK Setup Base Addresses
163 163 0001 0000 |RAM2 EQU RAM2_BASE&ADDRMASK Setup Base Addresses
164 164 0010 0000 |ROM2 EQU ROM2_BASE&ADDRMASK Setup Base Addresses
165 165 00FF E800 |FPCP EQU FPCP_BASE&ADDRMASK Setup Base Addresses
166 166 0004 0000 |IRAM EQU IRAM_BASE&ADDRMASK Setup Base Addresses
167 167 00FF F800 |AVEC_7 EQU AUTO_BASE&ADDRMASK Setup Base Addresses
168 168 |
169 169 0000 0000 |CSBAR_XX EQU $0000 Reset (unused) value for CSBARn
170 170 0000 0000 |CSOR_XX EQU $0000 Reset (unused) value for CSORn
171 171 |
172 172 0000 0A00 |MCR EQU SIM+$00 Module Control Register
173 173 0000 0006 |MM_BIT EQU 6 . MM bit number in MCR
174 174 0000 0A04 |SYNCR EQU SIM+$04 Clock Synthesizer Control Register
175 175 0000 4000 |VCO_X EQU $4000 VCO Frequency Control Bit X value
176 176 0000 0A20 |SYPCR EQU SIM+$20 System Protection Control Register
177 177 0000 0007 |SWE_BIT EQU 7 . SWE bit number in SYPCR
178 178 0000 0006 |SWP_BIT EQU 6 . SWP bit number in SYPCR
179 179 0000 0080 |SWE EQU 1<<7 . Software Watchdog Enable in SYPCR
180 180 0000 0040 |SWP EQU 1<<6 . Software Watchdog Prescale in SYPCR
181 181 0000 0008 |HME EQU 1<<3 . Halt Monitor Enable in SYPCR
182 182 0000 0004 |BME EQU 1<<2 . Bus Monitor Enable in SYPCR
183 183 0000 0003 |BMT8 EQU %11<<0 . Bus Monitor Timing 8 cycles in SYPCR
184 184 0000 0002 |BMT16 EQU %10<<0 . Bus Monitor Timing 16 cycles in SYPCR
185 185 0000 0001 |BMT32 EQU %01<<0 . Bus Monitor Timing 32 cycles in SYPCR
186 186 0000 0000 |BMT64 EQU %00<<0 . Bus Monitor Timing 64 cycles in SYPCR
187 187 0000 0A27 |SWSR EQU SIM+$27 Software Service Reg (WATCHDOG) = BYTE
188 188 0000 0055 |WATCHV1 EQU $55 . Software Watchdog value #1
189 189 0000 00AA |WATCHV2 EQU $AA . Software Watchdog value #2
190 190 0000 0A44 |CSPAR EQU SIM+$44 Chip Select Pin Assignment Register
191 191 0000 0A48 |CSBARBT EQU SIM+$48 Chip Select Base Boot Register
192 192 0000 0A4A |CSORBT EQU SIM+$4A Chip Select Option Boot Register
193 193 0000 0A4C |CSBAR0 EQU SIM+$4C Chip Select 0 Base Register
194 194 0000 0A4E |CSOR0 EQU SIM+$4E Chip Select 0 Option Register
195 195 0000 0A50 |CSBAR1 EQU SIM+$50 Chip Select 1 Base Register
196 196 0000 0A52 |CSOR1 EQU SIM+$52 Chip Select 1 Option Register
197 197 0000 0A54 |CSBAR2 EQU SIM+$54 Chip Select 2 Base Register
198 198 0000 0A56 |CSOR2 EQU SIM+$56 Chip Select 2 Option Register
199 199 |
200 200 |*
201 201 |* Option Register Equates (CSORBT, CSORn):
202 202 |*
203 203 0000 0000 |B2K EQU 0 2K block size
204 204 0000 0001 |B8K EQU 1 8K block size
205 205 0000 0002 |B16K EQU 2 16K block size
206 206 0000 0003 |B64K EQU 3 64K block size
207 207 0000 0004 |B128K EQU 4 128K block size
208 208 0000 0005 |B256K EQU 5 256K block size
209 209 0000 0006 |B512K EQU 6 512K block size
210 210 0000 0007 |B1M EQU 7 1MB block size
211 211 0000 0000 |ASYNC EQU $0000 Asynchronous mode
212 212 0000 8000 |SYNC EQU $8000 Synchronous mode
213 213 0000 4000 |CS_UPPB EQU 2*$2000 Upper byte
214 214 0000 2000 |CS_LOWB EQU 1*$2000 Lower byte
215 215 0000 6000 |CS_BOTHB EQU 3*$2000 Both bytes (upper or lower)
216 216 0000 0800 |CS_R EQU 1*$800 Read
217 217 0000 1000 |CS_W EQU 2*$800 Write
218 218 0000 1800 |CS_RW EQU 3*$800 Read or write
219 219 0000 0000 |CS_AS EQU 0*$400 Address Strobe (AS*)
220 220 0000 0400 |CS_DS EQU 1*$400 Data Strobe (DS*)
221 221 0000 000E |CS_FAST EQU 14 Fast termination DSACK*
222 222 0000 000F |CS_EXT EQU 15 External termination DSACK*
223 223 0000 0040 |CS_WAIT EQU 1*$40 Wait cycles for DSACK*
224 224 0000 0000 |CS_CSP EQU 0*$10 CPU space
225 225 0000 0010 |CS_USP EQU 1*$10 User space
226 226 0000 0020 |CS_SSP EQU 2*$10 Supervisor space
227 227 0000 0030 |CS_SUSP EQU 3*$10 Supervisor/User space
228 228 0000 0002 |CS_LVL EQU 1*$2 Interrupt priority level
229 229 0000 0001 |CS_AVEC EQU 1 Autovector enable
230 230 |
231 231 |
232 232 |******************************************************************************
233 233 |*
234 234 | SYSTEM
235 1m 0000 0001 +SECTD SET 1 ! DEFINE DATA SECTION
236 2m 0000 000E +SECTP SET 14 ! DEFINE PROGRAM SECTION
237 3m 0000 + SECTION SECTP ! PUT USER INTO PROG. SECTION
238 235 |
239 236 |* Start Chip Select Initialization:
240 237 |*
241 238 |INIT_CS:
242 239 0000 46FC 2700 | MOVE.W #SR_VAL,SR Ensure status register initialized.
243 240 0004 4BF8 F000 | LEA HI_BASE,A5 Assume registers are at high memory.
244 241 |
245 242 |* Set up CSBOOT CHIP SELECT:
246 243 |* - Long word also gets .CSORBT value into CSORBT register!
247 244 |* - Must set up wait cycles for Boot ROM before we change Bus Monitor
248 245 |* timeout value in SYPCR (allows booting in 8-bit mode!).
249 246 |* - SR and CSBOOT/CSORBT initialized by INIT_T1 routine. See
250 247 |* INITTBL.SA and RESETV.SA files for details. We repeat the init-
251 248 |* ialization here in case the user has by-passed/disabled calling
252 249 |* the INIT_T1 routine via the PWR_TBL1 Power On Branch vector.
253 250 |*
254 251 0008 2B7B 0170 | MOVE.L ((.CSBARBT).L,PC),CSBARBT(A5)
254 000C FFFF FFF4 |
254 0010 0A48 |
255 252 |
256 253 |* Set up SYSTEM PROTECTION REGISTER (SYPCR) per paramter area values:
257 254 |* - controls such things as Software Watchdog, Halt Monitor, Bus Monitor, etc.
258 255 |* - SYPCR is a write-once register!
259 256 0012 102D 0A20 | MOVE.B SYPCR(A5),D0
260 257 0016 7E00 | MOVEQ.L #0,D7 Clear all flag bits.
261 258 0018 0800 0006 | BTST #SWP_BIT,D0 Test SWP bit = MODCK* at Power Up
262 259 | IF <NE> THEN.S If bit set, then
263 1s 001C 6604 + BNE .1
264 260 001E 08C7 001F | BSET #EXTAL_BIT,D7 . Set External Clock flag bit on.
265 261 | ENDI
266 1s +.1:
267 262 0022 803B 0170 | OR.B ((SYPCR_OR).L,PC),D0
267 0026 FFFF FFDA |
268 263 002A C03B 0170 | AND.B ((SYPCR_AND).L,PC),D0
268 002E FFFF FFD2 |
269 264 0032 1B40 0A20 | MOVE.B D0,SYPCR(A5)
270 265 |* From now on, the Software Watchdog could be running! The SWE_BIT in SYPCR_AND
271 266 |* controls the Software Watchdog as follows:
272 267 |* 0 = Watchdog is disabled
273 268 |* 1 = Watchdog is enabled
274 269 |* The SWE_BIT in the real SYPCR register can also be tested, but is usually a
275 270 |* bit more difficult because the module register block is movable!
276 271 |
277 272 |* Now let's go to 16.7 MHZ:
278 273 |*
279 274 0036 006D 4000 | OR.W #VCO_X,SYNCR(A5) X-bit doubles the current speed!
279 003A 0A04 |
280 275 |
281 276 |* Set up Module Configuration Register (MCR) per paramter area values:
282 277 |* - controls such things as FRZBM, MM, IARB, etc.
283 278 003C 302D 0A00 | MOVE.W MCR(A5),D0
284 279 0040 807B 0170 | OR.W ((MCR_OR).L,PC),D0
284 0044 FFFF FFBC |
285 280 0048 C07B 0170 | AND.W ((MCR_AND).L,PC),D0
285 004C FFFF FFB4 |
286 281 0050 3B40 0A00 | MOVE.W D0,MCR(A5)
287 282 |* From now on, the registers could have been relocated to low memory!
288 283 |
289 284 0054 0800 0006 | BTST #MM_BIT,D0
290 285 | IF <EQ> THEN.S If MM bit = 0, then
291 1s 0058 6706 + BEQ .2
292 286 005A 4BF9 007F | LEA LO_BASE,A5 . registers are at low memory!
292 005E F000 |
293 287 | ENDI
294 1s +.2:
295 288 |* [A5] = register module base address!
296 289 |
297 290 |* Service the Software Watchdog (just in case it's running!):
298 291 0060 1B7C 0055 | MOVE.B #WATCHV1,SWSR(A5)
298 0064 0A27 |
299 292 0066 1B7C 00AA | MOVE.B #WATCHV2,SWSR(A5)
299 006A 0A27 |
300 293 |
301 294 |*
302 295 |* Set up all Chip Selects as "chip selects" in case user's have connected h/w
303 296 |* devices. Otherwise, address lines would be toggling as program runs and
304 297 |* possibly cause the devices to be enabled!
305 298 006C 2B7C FFFF | MOVE.L #$FFFFFFFF,CSPAR(A5) All = chip selects, 16-bit port
305 0070 FFFF 0A44 |
306 299 |* . (unused bits have no effect!)
307 300 |
308 301 |* Set up RAM and CSBOOT CHIP SELECTs to old BCC values:
309 302 |*
310 303 0074 2B7B 0170 | MOVE.L ((.CSBAR0).L,PC),CSBAR0(A5)
310 0078 FFFF FF88 |
310 007C 0A4C |
311 304 007E 2B7B 0170 | MOVE.L ((.CSBAR1).L,PC),CSBAR1(A5)
311 0082 FFFF FF7E |
311 0086 0A50 |
312 305 |
313 306 |* Test for old BBC by enabling its onboard RAM and ROM.
314 307 |* If RAM found, then
315 308 |* assume old BCC with old Platform Board
316 309 |* else
317 310 |* assume new BCC with new Platform Board
318 311 |* endif
319 312 |* If board == old_BCC
320 313 |* initialize chip selects for old BCC and old platform board
321 314 |* else
322 315 |* initialize chip selects for new BCC and new platform board
323 316 |* endif
324 317 |*
325 318 |* To find RAM:
326 319 |* ($0000) = $5AA5A55A
327 320 |* delay to allow bus capacitance to dissipate
328 321 |* if ($0000) == $5AA5A55A then
329 322 |* ($0000) = $A55A5AA5
330 323 |* delay to allow bus capacitance to dissipate
331 324 |* if ($0000) == $A55A5AA5 then
332 325 |* RAM found
333 326 |* endif
334 327 |* else
335 328 |* ($2F00) = $5AA5A55A
336 329 |* delay to allow bus capacitance to dissipate
337 330 |* if ($2F00) == $5AA5A55A then
338 331 |* ($2F00) = $A55A5AA5
339 332 |* delay to allow bus capacitance to dissipate
340 333 |* if ($2F00) == $A55A5AA5 then
341 334 |* RAM found
342 335 |* endif
343 336 |* endif
344 337 |* endif
345 338 |*
346 339 |
347 340 |* NOTE: By default at Power Up, CSBOOT responds to any address in the
348 341 |* range of $0-$FFFFF (block size= 1 MB) to select the Boot ROM.
349 342 |* Since the Boot ROM only uses address lines A0-A16 (128K), it
350 343 |* appears replicated thru the memory map at every even ROM size
351 344 |* ($20000) boundary as follows:
352 345 |* $00000, $20000, $40000, $60000, $80000, $A0000, $C0000, $E0000
353 346 |* Thus the power up reset vectors for the SP and PC are fetched from
354 347 |* locations $0-7 and the PC is set to the memory range where we will
355 348 |* be programming the Boot ROM to appear at via the chip selects.
356 349 |* When the programming occurs, there are no addressing "glitches"
357 350 |* because we stay at the same locations!
358 351 |
359 352 0088 7001 | MOVEQ.L #NEW_BCC,D0
360 353 008A 223C 5AA5 | MOVE.L #$5AA5A55A,D1 NOTE: D1 and D2 are inverse patterns!
360 008E A55A |
361 354 0090 243C A55A | MOVE.L #$A55A5AA5,D2
361 0094 5AA5 |
362 355 0096 91C8 | SUB.L A0,A0 Test loca. = $0000.
363 356 |
364 357 0098 2081 | MOVE.L D1,(A0)
365 358 | T_DELAY
366 1m 009A 4E71 + NOP
367 2m 009C 4E71 + NOP
368 3m 009E 4E71 + NOP
369 359 | IF.L D1 <EQ> (A0) THEN.S If test loca. is good, then
370 1s 00A0 B290 + CMP.L (A0),D1
371 2s 00A2 6610 + BNE .3
372 360 00A4 2082 | MOVE.L D2,(A0)
373 361 | T_DELAY
374 1m 00A6 4E71 + NOP
375 2m 00A8 4E71 + NOP
376 3m 00AA 4E71 + NOP
377 362 | IF.L D2 <EQ> (A0) THEN.S . If inverse is good, then
378 1s 00AC B490 + CMP.L (A0),D2
379 2s 00AE 6602 + BNE .4
380 363 00B0 7000 | MOVEQ.L #OLD_BCC,D0 . Got RAM, so must be old BCC!
381 364 | ENDI
382 1s +.4:
383 365 | ELSE.S else maybe just 1 bad loca.
384 1s 00B2 601E + BRA .5
385 2s +.3:
386 366 00B4 307C 2F00 | MOVE.W #$2F00,A0 . Test loca. = $2F00.
387 367 |*------------------------------------------------------------------------------
388 368 |* CAUTION: In the above "MOVE.W #$XXXX,A0" do not use an address with the
389 369 |* sign bit set, e.g., $8000, because sign extension will cause a
390 370 |* BUS ERROR below and crash the system! Also, the address must
391 371 |* not be in the user ram area ($3000-FFFF), or we could corrupt
392 372 |* the user's ram! Thus we use $2F00, which is inside CPU32Bug's
393 373 |* internal stack area.
394 374 |*------------------------------------------------------------------------------
395 375 00B8 2081 | MOVE.L D1,(A0)
396 376 | T_DELAY
397 1m 00BA 4E71 + NOP
398 2m 00BC 4E71 + NOP
399 3m 00BE 4E71 + NOP
400 377 | IF.L D1 <EQ> (A0) THEN.S . If test loca. is good, then
401 1s 00C0 B290 + CMP.L (A0),D1
402 2s 00C2 660E + BNE .6
403 378 00C4 2082 | MOVE.L D2,(A0)
404 379 | T_DELAY
405 1m 00C6 4E71 + NOP
406 2m 00C8 4E71 + NOP
407 3m 00CA 4E71 + NOP
408 380 | IF.L D2 <EQ> (A0) THEN.S . If inverse is good, then
409 1s 00CC B490 + CMP.L (A0),D2
410 2s 00CE 6602 + BNE .7
411 381 00D0 7000 | MOVEQ.L #OLD_BCC,D0 . Got RAM, so must be old BCC.
412 382 | ENDI
413 1s +.7:
414 383 | ENDI
415 1s +.6:
416 384 | ENDI
417 1s +.5:
418 385 |
419 386 |* Service the Software Watchdog (just in case it's running!):
420 387 00D2 1B7C 0055 | MOVE.B #WATCHV1,SWSR(A5)
420 00D6 0A27 |
421 388 00D8 1B7C 00AA | MOVE.B #WATCHV2,SWSR(A5)
421 00DC 0A27 |
422 389 |
423 390 00DE 0C00 0000 | CMP.B #OLD_BCC,D0
424 391 00E2 6610 | BNE.S BCC_NEW Branch if old BCC not found!
425 392 |
426 393 |* Here for old BCC and old Platform board (see Rev. 1 schematics for each):
427 394 |*
428 395 |* U1/U3 = 120 nsec RAM w/fast termination
429 396 |* U2/U4 = ROM, but laid out wrong, so can only be used as 120 nsec RAM!
430 397 |*
431 398 |* CSBOOT = BCC U4 332Bug EPROM
432 399 |* CS0 = BCC U3 read/write enable for MSB=UPPER=EVEN ram
433 400 |* CS1 = BCC U2 read/write enable for LSB=LOWER=ODD ram
434 401 |* CS2 = PFB U1/U3 read enable for MSB/LSB=BOTH rams
435 402 |* CS3 = PFB U1 write enable for LSB=LOWER=ODD ram
436 403 |* CS4 = PFB U4 read enable for MSB=UPPER=EVEN ram/eprom
437 404 |* CS5 = PFB U2 read enable for LSB=LOWER=ODD ram/eprom
438 405 |* CS6 = PFB U5 chip enable for MC68881/882
439 406 |* CS7 = <unused>
440 407 |* CS8 = PFB ABORT pushbutton autovector
441 408 |* CS9 = <unused>
442 409 |* CS10 = PFB U3 write enable for MSB=UPPER=EVEN ram
443 410 |* . cut/jump U3-27 from CS4 to CS10 required!
444 411 |*
445 412 |* Set up other CHIP SELECT ports (CS0,CS1,CSBOOT already done):
446 413 |*
447 414 00E4 41FB 0170 |BCC_OLD LEA ((.CSBAR2).L,PC),A0 Point to old CS2 entry.
447 00E8 FFFF FF18 |
448 415 00EC 43ED 0A54 | LEA CSBAR2(A5),A1 Point to corresponding SIM reg.
449 416 00F0 7008 | MOVEQ.L #(10-2+1)-1,D0 Set count to do CS2-CS10.
450 417 |* . ("-1" for DBRA loop below!)
451 418 00F2 600E | BRA.S CS_COM Go to common init routine!
452 419 |
453 420 |
454 421 |* Here for new BCC and new Platform board (see Rev. 2 schematics for each):
455 422 |*
456 423 |* U1/U3 = 120 nsec RAM w/fast termination
457 424 |* U2/U4 = 250 nsec ROM (or jumper selectable as RAM)
458 425 |*
459 426 |* CSBOOT = BCC U4 CPU32Bug EPROM
460 427 |* CS0 = BCC U3 write enable for MSB=UPPER=EVEN ram
461 428 |* CS1 = BCC U2 write enable for LSB=LOWER=ODD ram
462 429 |* CS2 = BCC U3/U2 read enable for MSB/LSB=BOTH rams
463 430 |* CS3 = <unused>
464 431 |* CS4 = PFB ABORT pushbutton autovector
465 432 |* CS5 = PFB U5 chip enable for MC68881/882
466 433 |* . cut/jump U5-J3 from CS2 to CS5 required!
467 434 |* CS6 = PFB U2 read enable for LSB=LOWER=ODD ram/eprom
468 435 |* CS7 = PFB U4 read enable for MSB=UPPER=EVEN ram/eprom
469 436 |* CS8 = PFB U1/U3 read enable for MSB/LSB=BOTH rams
470 437 |* CS9 = PFB U1 write enable for LSB=LOWER=ODD ram
471 438 |* CS10 = PFB U3 write enable for MSB=UPPER=EVEN ram
472 439 |*
473 440 |* Set up all CHIP SELECT ports (CSBOOT already done):
474 441 |*
475 442 00F4 41FB 0170 |BCC_NEW LEA ((CSBAR0$).L,PC),A0 Point to new CS0 entry.
475 00F8 FFFF FF08 |
476 443 00FC 43ED 0A4C | LEA CSBAR0(A5),A1 Point to corresponding SIM reg.
477 444 0100 700A | MOVEQ.L #(10-0+1)-1,D0 Set count to do CS0-CS10.
478 445 |* . ("-1" for DBRA loop below!)
479 446 |
480 447 |* Common CHIP SELECTS initialization routine:
481 448 |* A0.L = chip select configuration table entry (base addr)
482 449 |* A1.L = corresponding SIM register
483 450 |* D0.W = number of chip selects -1 to be initialized
484 451 |*
485 452 0102 22D8 |CS_COM MOVE.L (A0)+,(A1)+ Init. SIM base addr + option register.
486 453 0104 51C8 FFFC | DBRA D0,CS_COM Continue until all regs init'ed.
487 454 |
488 455 |* Service the Software Watchdog (just in case it's running!):
489 456 0108 1B7C 0055 | MOVE.B #WATCHV1,SWSR(A5)
489 010C 0A27 |
490 457 010E 1B7C 00AA | MOVE.B #WATCHV2,SWSR(A5)
490 0112 0A27 |
491 458 |
492 459 |* [D7.L] = Power Up Status Flag
493 460 0114 60FF FFFF | BRA.L PWR_TBL2 Return to Power On Branch Vector
493 0118 FEEA |
494 461 | END
494 lines assembled
symbol table:
symbol name attrib. section value
----------- ------- ------- -----
INIT_CS .data 14 0x0
@241 @62
PWR_TBL2 xref
493 @65
.CSBAR0 xref
310 @66
.CSBAR1 xref
311 @66
.CSBAR2 xref
447 @66
.CSBARBT xref
254 @66
CSBAR0$ xref
475 @67
MCR_OR xref
284 @68
MCR_AND xref
285 @68
SYPCR_OR xref
267 @69
SYPCR_AND xref
268 @69
SYSTEM macro
234
T_DELAY macro
404 396 373 365
OLD_BCC abs. 0x0
423 411 380 @92
NEW_BCC abs. 0x1
359 @93
SR_VAL abs. 0x2700
242 @101
RAM_BASE abs. 0x0
161 123 @103
RAM_SIZE abs. 0x10000
125 @104
ROM1_BASE abs. 0xe0000
162 138 130 @105
ROM1_SIZE abs. 0x20000
138 @106
IRAM_BASE abs. 0x40000
166 @107
FPCP_BASE abs. 0xffffe800
165 @108
FCRYSTVAL abs. 0x8000
@110
HI_BASE abs. 0xfffff000
243 @111
LO_BASE abs. 0x7ff000
292 @113
SIM abs. 0xa00
198 197 196 195 194 193 192 191 190 187
176 174 172 @114
RAMCR abs. 0xb00
@115
QSM abs. 0xc00
@116
AUTO_BASE abs. 0xfffff800
167 @117
EXTAL_BIT abs. 0x1f
264 @120
CHKSUM_BIT abs. 0x1e
@121
LOCALRAM abs. 0x0
137 128 126 @123
SYSRAMSZ abs. 0x4000
127 126 @124
LCLRAMMX abs. 0x10000
137 127 @125
USRRAM abs. 0x4000
@126
USRRAMSZ abs. 0xc000
@127
RAMSTART abs. 0x0
@128
LOCALROM abs. 0xe0000
@130
LCLROMSZ abs. 0x10000
@131
ROMUNPGM abs. 0xff
133 @132
FILL.1 abs. 0xff
134 134 @133
FILL.2 abs. 0xffff
135 135 @134
FILL.4 abs. 0xffffffff
@135
RAM2_BASE abs. 0x10000
163 @137
ROM2_BASE abs. 0x100000
164 @138
VECTSIZ abs. 0x400
143 @140
USERLEN abs. 0x1000
143 @141
MEMINC abs. 0x4000
143 @142
STKLEN abs. 0x2bfc
@143
ABORTLVL abs. 0x7
@148
ABORTVEC abs. 0x1f
@149
ACFAILVL abs. 0x7
@150
ACFAILVC abs. 0x41
@151
TIMERLVL abs. 0x6
@152
TIMERVEC abs. 0x42
@153
ADDRMASK abs. 0xfff800
167 166 165 164 163 162 161 @160
RAM abs. 0x0
@161
ROM abs. 0xe0000
@162
RAM2 abs. 0x10000
@163
ROM2 abs. 0x100000
@164
FPCP abs. 0xffe800
@165
IRAM abs. 0x40000
@166
AVEC_7 abs. 0xfff800
@167
CSBAR_XX abs. 0x0
@169
CSOR_XX abs. 0x0
@170
MCR abs. 0xa00
286 283 @172
MM_BIT abs. 0x6
289 @173
SYNCR abs. 0xa04
279 @174
VCO_X abs. 0x4000
279 @175
SYPCR abs. 0xa20
269 259 @176
SWE_BIT abs. 0x7
@177
SWP_BIT abs. 0x6
261 @178
SWE abs. 0x80
@179
SWP abs. 0x40
@180
HME abs. 0x8
@181
BME abs. 0x4
@182
BMT8 abs. 0x3
@183
BMT16 abs. 0x2
@184
BMT32 abs. 0x1
@185
BMT64 abs. 0x0
@186
SWSR abs. 0xa27
490 489 421 420 299 298 @187
WATCHV1 abs. 0x55
489 420 298 @188
WATCHV2 abs. 0xaa
490 421 299 @189
CSPAR abs. 0xa44
305 @190
CSBARBT abs. 0xa48
254 @191
CSORBT abs. 0xa4a
@192
CSBAR0 abs. 0xa4c
476 310 @193
CSOR0 abs. 0xa4e
@194
CSBAR1 abs. 0xa50
311 @195
CSOR1 abs. 0xa52
@196
CSBAR2 abs. 0xa54
448 @197
CSOR2 abs. 0xa56
@198
B2K abs. 0x0
@203
B8K abs. 0x1
@204
B16K abs. 0x2
@205
B64K abs. 0x3
@206
B128K abs. 0x4
@207
B256K abs. 0x5
@208
B512K abs. 0x6
@209
B1M abs. 0x7
@210
ASYNC abs. 0x0
@211
SYNC abs. 0x8000
@212
CS_UPPB abs. 0x4000
@213
CS_LOWB abs. 0x2000
@214
CS_BOTHB abs. 0x6000
@215
CS_R abs. 0x800
@216
CS_W abs. 0x1000
@217
CS_RW abs. 0x1800
@218
CS_AS abs. 0x0
@219
CS_DS abs. 0x400
@220
CS_FAST abs. 0xe
@221
CS_EXT abs. 0xf
@222
CS_WAIT abs. 0x40
@223
CS_CSP abs. 0x0
@224
CS_USP abs. 0x10
@225
CS_SSP abs. 0x20
@226
CS_SUSP abs. 0x30
@227
CS_LVL abs. 0x2
@228
CS_AVEC abs. 0x1
@229
SECTD abs. 0x1
@235
SECTP abs. 0xe
237 @236
.1 .data 14 0x22
@266 263
.2 .data 14 0x60
@294 291
.3 .data 14 0xb4
@385 371
.4 .data 14 0xb2
@382 379
.5 .data 14 0xd2
@417 384
.6 .data 14 0xd2
@415 402
.7 .data 14 0xd2
@413 410
BCC_NEW .data 14 0xf4
@475 424
BCC_OLD .data 14 0xe4
@447
CS_COM .data 14 0x102
486 @485 451
.data section 14 0x0
132 symbols